package com.lvmama.config;

import com.lvmama.pojo.entity.rhino.system.Role;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.Date;
import java.util.List;


/**
 * 用户详情
 *
 * @author yong.cao
 * @since 2017年7月15日下午10:35:02
 */
@Getter
@Setter
public class MyUserDetail extends User {
    private static final long serialVersionUID = -5601031290898392331L;
    /**
     * 用户id
     */
    private String userId;
    /**
     * 用户名字
     */
    private String name;
    /**
     * 角色列表
     */
    private List<Role> roleList;

    /**
     * 最后登陆时间
     */
    private Date operateDate;

    MyUserDetail(String username, String password, Collection<? extends GrantedAuthority> authorities, String userId,
                 List<Role> roleList, String name, Date operateDate) {
        super(username, password, authorities);
        this.userId = userId;
        this.roleList = roleList;
        this.name = name;
        this.operateDate = operateDate;
    }
}
